import React from 'react';
import StorageOutlined from '@material-ui/icons/StorageOutlined';
import { NavView, get_mod, NavListSub, loc } from 'sui';
import { UserView } from './user';
import { GroupView } from './group/view';

const model = (cfg) => {
    const fix = [
        {uid: "kind.user", view: UserView, value: loc("l_724")},
        {uid: "kind.group", view: GroupView, value: loc("l_727")},
    ];

    return get_mod(cfg, fix, "kind");
};

const Kind = ({ mod, setEvent, sideopen, cfg }) => <NavView cfg={cfg} model={model(cfg)} mod={mod} setEvent={setEvent} sideopen={sideopen} name="kind"/>;

const NavKind = (props) => <NavListSub icon={<StorageOutlined/>} sub={model(props.cfg)} {...props} scut={15}/>;

export {NavKind, Kind};
